package com.ruoyi.smile.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.smile.mapper.McLikeMapper;
import com.ruoyi.smile.domain.McLike;
import com.ruoyi.smile.service.IMcLikeService;

/**
 * 点赞Service业务层处理
 * 
 * @author xin
 * @date 2025-03-18
 */
@Service
public class McLikeServiceImpl implements IMcLikeService 
{
    @Autowired
    private McLikeMapper mcLikeMapper;

    /**
     * 查询点赞
     * 
     * @param id 点赞主键
     * @return 点赞
     */
    @Override
    public McLike selectMcLikeById(Long id)
    {
        return mcLikeMapper.selectMcLikeById(id);
    }

    /**
     * 查询点赞列表
     * 
     * @param mcLike 点赞
     * @return 点赞
     */
    @Override
    public List<McLike> selectMcLikeList(McLike mcLike)
    {
        return mcLikeMapper.selectMcLikeList(mcLike);
    }

    /**
     * 新增点赞
     * 
     * @param mcLike 点赞
     * @return 结果
     */
    @Override
    public int insertMcLike(McLike mcLike)
    {
        mcLike.setCreateTime(DateUtils.getNowDate());
        return mcLikeMapper.insertMcLike(mcLike);
    }

    /**
     * 修改点赞
     * 
     * @param mcLike 点赞
     * @return 结果
     */
    @Override
    public int updateMcLike(McLike mcLike)
    {
        mcLike.setUpdateTime(DateUtils.getNowDate());
        return mcLikeMapper.updateMcLike(mcLike);
    }

    /**
     * 批量删除点赞
     * 
     * @param ids 需要删除的点赞主键
     * @return 结果
     */
    @Override
    public int deleteMcLikeByIds(Long[] ids)
    {
        return mcLikeMapper.deleteMcLikeByIds(ids);
    }

    /**
     * 删除点赞信息
     * 
     * @param id 点赞主键
     * @return 结果
     */
    @Override
    public int deleteMcLikeById(Long id)
    {
        return mcLikeMapper.deleteMcLikeById(id);
    }
}
